package testcase;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Author: zhangrongqing
 * @Date: 2020/2/20 15:11
 */
public class ThreadDemo {
    public static void main(String[] args) {
        final String str = "abc";
        ExecutorService executorService= Executors.newFixedThreadPool(3);
        executorService.execute(new Runnable() {
            @Override
            public void run() {
                System.out.println("1"+str);
            }
        });
        executorService.execute(new Runnable() {
            @Override
            public void run() {
                System.out.println("2"+str);
            }
        });
        executorService.execute(new Runnable() {
            @Override
            public void run() {
                System.out.println("3"+str);
            }
        });
    }
}
